<?php
/**
 * 广告图片
 * @author 江羿平<hugcolin@163.com>
 */

use Core\AdminController;
use Models\Car;
class CarController extends AdminController {

	/**
	 * 列表页
	 */
	public function index(){
		
		$car = new Car;
		$cars = $car->paginate(20);
		$this->load->view('admin/car/index',array('cars'=>$cars));
	}
	


	/**
	 * 删除
	 */
	public function delete(){
		$car = new car;
		$car->delete($this->input->post('id'));
		echo json_encode(array('code'=>0,'msg'=>'ok'));
	}

	public function status(){
		$car = new car;
		$car->update($this->input->post('id'),['status'=>1]);
		echo json_encode(array('code'=>0,'msg'=>'ok'));
	}

}
